package com.gupt.weekly.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

/**
 * @author linzizun
 * @version 1.0
 * @date 2021/03/24 10:45
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(description = "角色信息")
@TableName(value = "tb_role")
public class Role {
    @ApiModelProperty(value = "主键非空", example = "自动生成，引号内删掉留空")
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    @NotBlank(message = "姓名不能为空")
    @ApiModelProperty(value = "名称，非空唯一", example = "张三")
    private String name;

    @ApiModelProperty(value = "描述", example = "幼儿园一班班长")
    private String details;

    @Max(value = 3, message = "数据不符合规格（1 管理，2 组长，3 组员）")
    @Min(value = 1, message = "数据不符合规格（1 管理，2 组长，3 组员）")
    @ApiModelProperty(value = "级别：1 管理，2 组长，3 组员", example = "2")
    private Integer grade;

    @ApiModelProperty(value = "上级id，关联本表.id", example = "")
    private String parent_id;
}
